﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed

#pragma once

#include "IGeometry.h"

namespace gcmp
{
    class ICurve2d;

    class ILoop : public IGeometry
    {
    public:

        /// \brief   获取环中曲线的数量
        /// \return  曲线的数量
        virtual int GetCurveCount()const = 0;

        /// \brief  获取指定索引处的二维曲线(拷贝实现)
        /// \param  index    索引
        /// \return 索引在二维边链表范围内返回拷贝后的二维边，否则返回空
        virtual OwnerPtr<ICurve2d> GetCurve(int index)const = 0;

        /// \brief   按顺序获取环中所有的曲线（拷贝实现）
        /// \param   curve2dlist 曲线链表
        /// \return  成功返回true,否则返回false
        virtual bool GetAllCurves(std::vector<OwnerPtr<ICurve2d>>& curve2dlist) const = 0;

        /// \brief   判断环是否为逆时针
        /// \return  逆时针返回true,否则返回false
        virtual bool IsAnticlockwise() const = 0;

        /// \brief  判断环是否合法
        /// \return 合法返回True，否则返回False
        virtual bool IsValid() const = 0;

    public:
        virtual ~ILoop() {}
    };
}